package com.example.data_show.controller;


import com.example.data_show.common.Result;
import com.example.data_show.entity.Daydate;
import com.example.data_show.service.DaydateService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/daydate")
public class DaydateController {

    @Resource
    private DaydateService daydateService;

    @GetMapping("/all")
    public List<Daydate> findAll() {
//        System.out.println("asdasdas");
//        List<Daydate> daydates = daydateService.all();
//        for (Daydate daydate : daydates) {
//            // 处理每个元素
//            System.out.println(daydate.getDay());
//            System.out.println(daydate.getId());
//            System.out.println(daydate.getNum());
//        }
        System.out.println(daydateService.all());
        return daydateService.all();
    }
}
